/*
 * @Author: Superficial
 * @Date: 2021-10-22 15:38:45
 * @LastEditTime: 2022-06-01 00:37:11
 * @Description: 链接构造器
 */
import { GUESTBOOK_POST_ID } from '@app/constants/biz.constant'
import * as APP_CONFIG from '@app/app.config'

export function getTagUrl(tagSlug: string): string {
  return `${APP_CONFIG.APP.URL}/tag/${tagSlug}`
}

export function getCategoryUrl(categorySlug: string): string {
  return `${APP_CONFIG.APP.URL}/category/${categorySlug}`
}

export function getArticleUrl(articleId: string | number): string {
  return `${APP_CONFIG.APP.URL}/article/${articleId}`
}

export function getGustbookPageUrl(): string {
  return `${APP_CONFIG.APP.URL}/guestbook`
}

export function getAboutPageUrl(): string {
  return `${APP_CONFIG.APP.URL}/about`
}

export function getArchivePageUrl(): string {
  return `${APP_CONFIG.APP.URL}/archive`
}

export function getGuestbookPageUrl(): string {
  return `${APP_CONFIG.APP.FE_URL}/guestbook`
}

export function getPermalinkByID(id: number): string {
  return id === GUESTBOOK_POST_ID ? getGuestbookPageUrl() : getArticleUrl(id)
}
